import request from '@/utils/request'

/**
 * 运行工单API
 */

// 查询运行工单列表
export function listRunWorkOrder(params) {
  return request({
    url: '/operation/web/operationRunWorkOrder/list',
    method: 'get',
    params
  })
}

// 获取工单类型下拉列表
export function getWorkOrderTypeList() {
  return request({
    url: '/operation/web/operationRunWorkOrder/workOrderTypeList',
    method: 'get'
  })
}

// 获取巡检区域下拉列表
export function getInspectionAreaList() {
  return request({
    url: '/operation/web/operationRunWorkOrder/inspectionAreaList',
    method: 'get'
  })
}

// 获取运行工单详细信息
export function getRunWorkOrderDetail(id) {
  return request({
    url: `/operation/web/operationRunWorkOrder/${id}`,
    method: 'get'
  })
}

// 新增运行工单
export function addRunWorkOrder(data) {
  return request({
    url: '/operation/web/operationRunWorkOrder',
    method: 'post',
    data
  })
}

// 修改运行工单
export function updateRunWorkOrder(data) {
  return request({
    url: '/operation/web/operationRunWorkOrder',
    method: 'put',
    data
  })
}

// 处理工单
export function handleRunWorkOrder(data) {
  return request({
    url: '/operation/web/operationRunWorkOrder/handle',
    method: 'post',
    data
  })
}